﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt
{
	// Token: 0x02000099 RID: 153
	public class TCreateSynonymStmt : TCustomSqlStatement
	{
		// Token: 0x06000465 RID: 1125 RVA: 0x002FB439 File Offset: 0x002F9639
		public TCreateSynonymStmt(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstcreatesynonym;
		}

		// Token: 0x17000094 RID: 148
		// (get) Token: 0x06000466 RID: 1126 RVA: 0x002FB44A File Offset: 0x002F964A
		// (set) Token: 0x06000467 RID: 1127 RVA: 0x002FB452 File Offset: 0x002F9652
		public virtual TObjectName ForName
		{
			get
			{
				return this.forName;
			}
			set
			{
				this.forName = value;
			}
		}

		// Token: 0x17000095 RID: 149
		// (get) Token: 0x06000468 RID: 1128 RVA: 0x002FB45B File Offset: 0x002F965B
		// (set) Token: 0x06000469 RID: 1129 RVA: 0x002FB463 File Offset: 0x002F9663
		public virtual TObjectName SynonymName
		{
			get
			{
				return this.synonymName;
			}
			set
			{
				this.synonymName = value;
			}
		}

		// Token: 0x0600046A RID: 1130 RVA: 0x002FB46C File Offset: 0x002F966C
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			TCreateSynonymSqlNode tcreateSynonymSqlNode = (TCreateSynonymSqlNode)this.rootNode;
			this.synonymName = tcreateSynonymSqlNode.SynonymName;
			base.DatabaseObjects.Add(this.synonymName);
			this.forName = tcreateSynonymSqlNode.ForName;
			this.isPublic = tcreateSynonymSqlNode.Public;
			return 0;
		}

		// Token: 0x17000096 RID: 150
		// (get) Token: 0x0600046B RID: 1131 RVA: 0x002FB4CD File Offset: 0x002F96CD
		// (set) Token: 0x0600046C RID: 1132 RVA: 0x002FB4D5 File Offset: 0x002F96D5
		public virtual bool Public
		{
			get
			{
				return this.isPublic;
			}
			set
			{
				this.isPublic = value;
			}
		}

		// Token: 0x0600046D RID: 1133 RVA: 0x002FB4DE File Offset: 0x002F96DE
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x0600046E RID: 1134 RVA: 0x002FB4EE File Offset: 0x002F96EE
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x040010F3 RID: 4339
		private TObjectName synonymName;

		// Token: 0x040010F4 RID: 4340
		private TObjectName forName;

		// Token: 0x040010F5 RID: 4341
		private bool isPublic;
	}
}
